package cn.cnf.common.enums;

/**
 * @author ZhuMeiYi
 * @date 2020/12/6 16:59
 * @description 漫画&小说 类型
 */
public enum WorkType {
    /**
     * 漫画和小说
     */
    COMIC("漫画", 1),
    NOVEL("小说", 2);

    /**
     * 类型
     */
    private String type;
    /**
     * 值
     */
    private Integer value;

    WorkType(String type, Integer value) {
        this.type = type;
        this.value = value;
    }

    public static WorkType getByValue(Integer value) {
        for (WorkType workType : values()) {
            if (workType.getValue().equals(value)) {
                return workType;
            }
        }
        return null;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }
}
